<template>
  <div class="card">
    <a-spin :spinning="loading">
      <a-form :form="formData" :label-col="{ span: 5 }" :wrapper-col="{ span: 6 }">
        <a-form-item label="实名开关">
          <a-radio-group v-model="formData.real_status" name="radioGroup">
            <a-radio value="1">开启</a-radio>
            <a-radio value="0">关闭</a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item label="实名短信内容">
          <a-textarea
            v-model="formData.real_content"
            :autosize="{ minRows: 3, maxRows: 6 }"
            placeholder="请输入"
            allow-clear
          />
        </a-form-item>
        <a-form-item label="绑卡开关">
          <a-radio-group v-model="formData.bind_status" name="radioGroupoff">
            <a-radio value="1">开启</a-radio>
            <a-radio value="0">关闭</a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item label="绑卡短信内容">
          <a-textarea
            v-model="formData.bind_content"
            :autosize="{ minRows: 3, maxRows: 6 }"
            placeholder="请输入"
            allow-clear
          />
        </a-form-item>
        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
          <a-button style="margin-right: 10px" type="primary" @click="submie">提交</a-button>
          <a-button @click="reset()">重置</a-button>
        </a-form-item>
      </a-form>
    </a-spin>
  </div>
</template>

<script>
import { getIncomeListAPI } from '@/api/follow.js'
export default {
  name: 'automaticfollowsetting',
  data() {
    return {
      loading: false,
      formData: {
        brand_id: process.env.VUE_APP_BRAND_ID,
        real_status: '1', //实名开关
        real_content: '', // 实名短信内容
        bind_status: '1', //绑卡开关
        bind_content: '', // 绑卡短信内容
        scene: 'chase_user_auto'
      }
    }
  },
  methods: {
    async submie() {
      try {
        this.loading = true
        const { msg } = await getIncomeListAPI(this.formData)
        this.$message.success(msg)
      } finally {
        this.loading = false
      }
    },
    reset() {
      this.formData = {
        brand_id: process.env.VUE_APP_BRAND_ID,
        real_status: '1',
        real_content: '',
        bind_status: '1',
        bind_content: '',
        scene: 'chase_user_auto'
      }
    }
  }
}
</script>

<style lang="less" scoped>
.card {
  padding: 20px;
  background-color: #fff;
}
</style>
